#ifndef __BASE_WINDOW
#define __BASE_WINDOW

#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>

#include "mxCaptionBarButtons.hpp"

class DummyControl : public TControl {
  friend class TBaseWindowForm;
};

class TBaseWindowForm : public TForm {
  __published:
        TmxCaptionBarButtons *btnCaption;
        void __fastcall FormResize(TObject *Sender);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
        void __fastcall idClose(TObject *Sender);
  private:
    WLWindowInfo Base;

    DummyControl *MoveControl;
    TPoint        LastPt;

    bool         CapVisible;

  protected:
    virtual void __fastcall CreateWindowHandle(const TCreateParams &Params);

    void __fastcall idMouseDown(TObject *Sender,TMouseButton Button, TShiftState Shift, int X, int Y);
    void __fastcall idMouseMove(TObject *Sender,TShiftState Shift, int X, int Y);
    void __fastcall idMouseUp(TObject *Sender,TMouseButton Button, TShiftState Shift, int X, int Y);

  public:
    __fastcall TBaseWindowForm( TComponent* Owner );

    void SetupBase( PWLWindowInfo p );

    void Save( PHConfigItem cfg );
    void Load( PHConfigItem cfg );

    bool SetOption( MVWC_Options op, LPCVOID param );
    bool GetOption( MVWC_Options op, LPVOID param );
};

#endif
 